#include<stdio.h>
#include<stdlib.h>
#include<string.h>

int main(int argc, char* argv[])        //argv是指针数组
{
    if(argc != 2)
    {
        printf("%d\n", argc);
        printf("程序执行失败！\n");
        exit(1);
    }

    printf("snowdragon:%s\n", getenv("snowdragon"));        //环境变量名需要与传入的环境变量名相同才能获取到

    if(strcmp(argv[1], "a") == 0)       //需要用strcmp对两个值进行判断，而不能用==直接判断
    {
        printf("snowdragon receive a!\n");
    }
    else if(strcmp(argv[1], "b") == 0)
    {
        printf("snowdragon receive b!\n");
    }
    else if(strcmp(argv[1], "c") == 0)
    {
        printf("snowdragon receive c!\n");
    }
    else
    {
        printf("default\n");
    }

    return 0;
}
